import Opt from '@/components/dt/info/Opt.js'
import organizationOpt from '@/biz/option/organization.js'
import houseOpt from '@/biz/option/house.js'
let _this = null
class SearchOpt extends Opt {
  constructor(vm) {
    super()
    _this = vm
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      organizationOpt.create({
        key: 'orgIds',
        title: '组织筛选',
        placeholder: '请选择',
        level: 3,
        saveAll: true
        // change: (v) => {
        //   console.log(v.value, 'bbb')
        //   _this.serchChange(v.value)
        // }
      }),

      {
        title: '案场状态',
        placeholder: '请输入案场状态',
        key: 'buildingStatus',
        select: {
          options: _this.$dt.dictInfo().buildStatus,
          multiple: true
        }
      },
      houseOpt.create({
        to: (info) => {
          return {
            buildingId: info.housesId
          }
        }
      })
    ]
  }
}

export default SearchOpt
